#pragma once

#include <QTextEdit>
#include <QMouseEvent>
#include <QListWidget>
#include <QFocusEvent>

typedef struct
{
	int pos;
	QStringList strList;
	QString currentStr;
	int index;
}textValue;

typedef struct
{
	int pos;
	QString strValue;
}clicketText;

class Pacs_MyTextEdit : public QTextEdit
{
	Q_OBJECT

public:
	Pacs_MyTextEdit(QWidget *parent = nullptr);
	~Pacs_MyTextEdit();
public:
	void setShowText(QString str);
	void coverShowText(QString str);
	/*bool eventFilter(QObject *, QEvent *);*/

protected:
	void mousePressEvent(QMouseEvent *e);
	void focusIntEvent(QFocusEvent *e);
	void focusOutEvent(QFocusEvent *e);
	//void closeEvent(QCloseEvent *event);
private:
	void inserFormatText(int pos,QString value);
	void setEditText(QString newStr);
	void setAppendText(QString appendText);
private slots:
	void on_strView_itemClicked(QListWidgetItem *item);
private:
	int m_textAddLength;
	int m_currentIndex;
	QListWidget *m_strListView;
	int m_appentTextCount;
};
